var tUrlMap = {
	statRecord:"../record/stat.do"
};

$(document).ready(function(){
	$("#statBt").button();
	$("#stat_body :text").attr("class","text ui-widget ui-widget-content ui-corner-all");
	$("#tBeginDate").datepicker();
	$("#tBeginDate").datepicker("setDate",'-1w');
	$("#tEndDate").datepicker();
	$("#tEndDate").datepicker("setDate",'+0d');
});

function stat(){
	var params={};
	params.beginDate = $("#tBeginDate").val();
	params.endDate = $("#tEndDate").val();
	commonUtil.jsonPost(tUrlMap["statRecord"],params,function(data){
		if(data){
			commonUtil.generateDataTable(data.statList,"databody_stat",function(rowData,rowCount,tbody){
				var html = "<tr><th class='ui-widget-header'>&nbsp;"+rowData.source+"：&nbsp;</th>";
				html+="<td>&nbsp;&nbsp;共接手 "+rowData.receieve+" 笔，完成 "+rowData.finish+" 笔，其中历史遗留的 "+rowData.history+" 笔。";
				html+="共 "+rowData.notFinished+" 笔未完成记录，其中本期接手 "+rowData.hisPassed+" 笔，转交中 "+rowData.passed+" 笔。</td></tr>";
				return html;
			});
		}
	},"#databody_stat");
}
